<link href="${rc.getContextPath()}/manage/css/dwzCustomCss/dwz.custom.css?v=${ver}" rel="stylesheet" type="text/css">
<div class="pageContent">
        <form  method="post" id="sequenceForm" action="" class="pageForm required-validate">
        <div class="pageFormContent">
            <input type="hidden" name="navTabId" value="${navTabId!''}">
			<fieldset class="dataset">
                <dl>
                    <dt><@label key="sequenceCode.C,colon">序列编号：</@label></dt>
                    <dd>
                        <input name="sequenceCode" value="${sequence.sequenceCode!''}"
                            size="32" type="text" maxlength="20" class="required alphanumeric toUp"  readonly="readonly" /> 
                    </dd>
                </dl>
                <dl>
                    <dt><@label key="sequenceText.C,colon">序列描述：</@label></dt>
                    <dd>
                        <input name="sequenceText" value="${sequence.sequenceText!''}"
                            size="32" type="text" maxlength="20" class="required" 
                        /> 
                    </dd>
                </dl>
              	<dl>
                    <dt><@label key="nextValue.C,colon">下一个值：</@label></dt>
                    <dd>
                    	<input type="hidden" name="oldNextValue" value="${sequence.nextValue!''}">
                        <input name="nextValue"  value="${sequence.nextValue!''}"
                            size="32" type="text" maxlength="18" class="required digits" /> 
                    </dd>
                </dl>
            </fieldset>
        </div>
	        <#if sequence??>
	            <#assign createInfo=sequence>
	            <#include "/common/createInfo.html">
	        </#if>                  
        <div class="formBar">
            <ul>
                    <li>
	                    <div class="buttonActive">
	                        <div class="buttonContent">
	                            <button type="button" name="saveSequence"><@label key="save.B">保存</@label></button>
	                        </div>
	                    </div>
	                </li>
	                <li>
	                    <div class="buttonActiveGrey">
	                        <div class="buttonContent">
	                                <button type="button" class="close" ><@label key="cancel.B">取消</@label></button>
	                        </div>
	                    </div>
	                </li>  
            </ul>
        </div>
    </form>
</div>
<script type="text/javascript">
var $page = DWZ.context();
$(function(){
	$("button[name='saveSequence']", $page).click(function(){ 
    	var $form =$("#sequenceForm", $page);
    	var d=$form.serializeArray();
   		var oldNextValue = $("input[name='oldNextValue']",$page).val();
   		var newNextValue = $("input[name='nextValue']",$page).val();
   		if(parseInt(oldNextValue)>parseInt(newNextValue)){ 
   			alertMsg.confirm("<@label key='nextValue.M'>修改的序列下一值小于当前值，可能会出现重复，确认修改？</@label>", {
   	            okCall : function() {  
   	            	$.ajax({
   	                   type:'POST',
   	                   url:'${rc.getContextPath()}/manage/sequence/saveSequence',
   	                   data:d,
   	                   dataType:"json",
   	                   cache: false,
   	                   success: function(data){
   	                	dialogAjaxDone(data);},
   	                	error: DWZ.ajaxError
   	               });
   	            }
   	        });
   		}else{
   			$.ajax({
                   type:'POST',
                   url:'${rc.getContextPath()}/manage/sequence/saveSequence',
                   data:d,
                   dataType:"json",
                   cache: false,
                   success: function(data){
                	dialogAjaxDone(data);},
                	error: DWZ.ajaxError
               });
   		}; 
    }); 
})
</script>